<?php
require_once 'PHPUnit\Framework.php';
require_once 'TodayResult.class.php';
require_once 'helpFunctions.php';

class TestTodayResult extends PHPUnit_Framework_TestCase {
	protected $MB_Sep08;
	public function setUp() {
		$this -> MB_Sep08 = new TodayResult('WAP888\Data\live_MB_Sep08.xml');
	}
	
	public function testResultAccToID_MB() {
		
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(0),array("43382")) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(1),array("44736")) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(2),array("40356","09983")) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(3),array("49606","01948","83788","70836","42054","65750" )) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(4),array("3759","0041","7646","2621" )) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(5),array("5515","1253","5017","5384","4876","3069" ) ) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(6),array("439","593","065")) );
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getResultForPrizeID(7),array("01","39","15","02")) );	
		
	}
	
	public function testAllResults_MB() {
		$rightResult = array (
			array("43382"),
			array("44736"),
			array("40356","09983"),
			array("49606","01948","83788","70836","42054","65750"),
			array("3759","0041","7646","2621"),
			array("5515","1253","5017","5384","4876","3069"),
			array("439","593","065"),
			array("01","39","15","02")
		);
		
		$this -> assertTrue( HelpFunctions::equalsArray($this -> MB_Sep08 -> getPrizeList(),$rightResult));
	}
	
	public function testDate_MB() {
		$rightResult = "Ngay 08 thang 09 nam 2009";
		$this -> assertEquals($rightResult,$this->MB_Sep08->getDate());		
	}
	
	public function testShowResults_MB() {
		//$this -> MB_Sep08 -> showResults_WAP();
		$this -> assertTrue( true );
	}
}
?>